<!--
  -- @module vue-demo
  -- @desc 列表
  -- @author ervinewell on 2017/4/7
  -->

<template>
  <div>
    <List
      :total-count="listState.totalCount"
      :page-no="listState.pageNo"
      :page-size="listState.pageSize"
      :list="listState.list"
      :loading="listState.loading"
    >
    </List>
  </div>
</template>

<style>
</style>

<script>
  import { mapState } from 'vuex';

  import List from './components/List.vue';
  import * as types from './store/types';

  export default {
    computed: {
      ...mapState({
        listState: state => state.list.list,
      }),
    },
    methods: {
      getList() {
        this.$store.dispatch(types.GET_LIST);
      },
    },
    components: {
      List,
    },
    created() {
      this.getList();
    },
  }
</script>
